﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace MachineQA
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void SetupButton_Click(object sender, RoutedEventArgs e)
        {
            SiteManagementDialog siteDialog = new SiteManagementDialog();
            siteDialog.ShowDialog();
        }

        /// <summary>
        /// Needed as for some reason otherwise two windows will get created one without tabs.
        /// </summary>
        /// <param name="sender">Sending object.</param>
        /// <param name="e">Event arguments</param>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {   
            if (MainContent.Content == null)
            {
                this.Close();
            }
            else
            {
                this.Visibility = System.Windows.Visibility.Visible;
            }
        }

        private void AboutMenuItem_Click(object sender, RoutedEventArgs e)
        {
            AboutBox dialog = new AboutBox();
            dialog.ShowDialog();
        }

        private void SetupTab_GotFocus(object sender, RoutedEventArgs e)
        {
        }
    }
}
